#include <vcl.h>
#pragma hdrstop


#include <System.hpp>


int n = 0, m = 0, a = 0, B = 0;
int a[ 100000/*# range 1..100000*/ ];

int main(int argc, char* argv[])
{
  Read( n ); ReadLn( m );
  for ( int stop = m, i = 1; i <= stop; i++)
  {
    Read( a ); ReadLn( B );
  }
  ReadLn( sc );
  for ( int stop = n, i = 1; i <= stop; i++)
    if ( "[ ] " + sc == sa[i] )
      WriteLn( "[/] " + sc );
    else
      WriteLn( sa[i] );
  return 0;
}
